home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 14 / MacFormat n. 14 (Spain) / MacFormat 14.bin / Shareware Internet / HyperCard / XCMD Docs / CompileIt! Source Code / NewXWind rect1,rect2,rect3,rec… < prev    next >
Encoding:
Text File  |  1995-08-19  |  1.6 KB  |  56 lines

  1. Global aRect:R,TheMouse:L
  2. on NewXWind rect1,rect2,rect3,rect4,name,WType,ControlID,min,max,now,CRect,CTitle
  3.   global MXW,CID,L,H,N,CRCT,CHandle,CTTL
  4.   put CRect into CRCT
  5.   put min into L
  6.   put max into H
  7.   put now into N
  8.   put ControlID into CID
  9.   SetRect aRect,rect1,rect2,rect3,rect4
  10.   put NewXWindow(aRect,name,true,WType,true,false) into MXW
  11. end NewXWind
  12.  
  13.  
  14. on OpenEvent j
  15.   global MXW,CID,L,H,N,CRCT,CHandle,CTTL
  16.   setRect aRect,item 1 of CRCT,item 2 of CRCT,item 3 of CRCT,item 4 of CRCT
  17.   put NewControl (MXW, aRect, CTTL, true, N, L, H, CID, 0) into CHandle
  18.   DrawControls MXW
  19. end OpenEvent
  20.  
  21. Global JJ:L,j:L
  22. on MouseDownEvent ee
  23.   Global CHandle,crct,MXW
  24.   SelectWindow MXW
  25.   DrawControls MXW
  26.   GetPort OldPort
  27.   SetPort MXW
  28.   put ee@.where into jj
  29.   put MXW into temp
  30.   get FindWindow(jj,temp)
  31.   if it = InContent then
  32.     put jj.integerType[1] into j.integerType[2]
  33.     put jj.integerType[2] into j.integerType[1]
  34.     GlobalToLocal j
  35.     put j.integerType[1] into jj.integerType[2]
  36.     put j.integerType[2] into jj.integerType[1]
  37.     put j.integerType[1] into h
  38.     put j.integerType[2] into v
  39.     if (h&","&v) is within crct then
  40.       get TrackControl(Chandle, jj, -1)
  41.     end if
  42.   else if it = inDrag then
  43.     put WMgrPort@.portRect.topLeft into aRect.topleft
  44.     put WMgrPort@.portRect.botRight into aRect.botRight
  45.     DragWindow  MXW, jj, aRect
  46.     MoveControl CHandle,1,1
  47.     MoveControl CHandle,0,0
  48.     DrawControls MXW
  49.   else if it =  inGoAway then if TrackGoAway(MXW,jj) then CloseXWindow MXW
  50.   SetPort OldPort
  51. end MouseDownEvent
  52.  
  53. function CloseEvent J
  54.   global MXW, CHandle
  55.   return true
  56. end CloseEvent